package com.itcast.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.itcast.pojo.Goods;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ${author}
 * @since 2020-06-19
 */
public interface Goodsservice extends IService<Goods> {
    /*新品推荐*/
    List<Goods> newGoods(String search);
    /*热销产品*/
    List<Goods> selectproductsrank(String search);
    /*好品推荐*/
    List<Goods> goodProductsRank(String search);

    /**
     * 商品详情
     * @param id
     * @return
     */
     Goods getByIdGoods(Integer id);

    /**
     * 根据类型查询
     * @param item
     * @return
     */
    List<Goods> getByItemGoods(String item);

    /**
     * 价钱排序
     * @return
     */

    List<Goods> getByPrice();

    /**
     * 浏览最多排序
     * @return
     */
    List<Goods> getByView();

    PageInfo<Goods> getGoodsWithPage1(Integer pageIndex, Integer pageSize,Goods goods);

    /**
     * 推荐商品，条件带分页
     * @return
     */
    PageInfo<Goods>  getGoodsByConditionAndPage(Map<String,String> conditionData);

    PageInfo<Goods> getAllGoodsByConditionAndPage(Map<String, String> conditionData);

    PageInfo<Goods> getGoodsHotByConditionAndPage(Map<String, String> conditionData);

    /**
     * 猜你喜欢
     */

    List<Goods> selectproductsliketest(ArrayList<Integer> gid);
    List<Goods> selectproductslike3();
    List<Goods> selectproductslike2();

    /**
     * 根据用户ID获得收藏商品
     * @param userId
     * @return
     */
    List<Goods> getByUserId(String userId);

    /**
     * 收藏
     * @param conditionData
     * @return
     */

    PageInfo<Goods> getCollectByUser(Map<String, String> conditionData);
}
